import 'package:shared_preferences/shared_preferences.dart';

class AppPreferences {
  AppPreferences._();
  static final shared = AppPreferences._();

  late SharedPreferences _preferences;

  static const _kFirstOpened = 'first_opened';

  bool get isFirstRun => !(_preferences.getBool(_kFirstOpened) ?? false);

  void setFirstOpened() => _preferences.setBool(_kFirstOpened, true);

  Future<void> init() async {
    _preferences = await SharedPreferences.getInstance();
  }
}
